{{ define "content" }}
<div id="content" class="stats">
  <div id="accordion">
  {{ range .stats }}
    <div class="card fuzzer">

      <div class="card-header" id="heading-{{ .FuzzerProcessID }}">
        <a data-toggle="collapse" href="#collapse-{{ .FuzzerProcessID }}" aria-controls="collapse-{{ .FuzzerProcessID }}" class="d-block">
          <i class="fas fa-chevron-down float-right"></i>
          {{ .AFLBanner }} @ {{ .FuzzerProcessID }}
        </a>
      </div>

      <div class="card-body">
        <div id="collapse-{{ .FuzzerProcessID }}" class="stat collapse show card-deck">

          <div class="card stat">
            <h5 class="card-header">Process timing</h5>
            <div class="card-body">
              <ul class="list-group list-group-flush">
                <li class="list-group-item">
                  Run time:
                  <pre>{{ formatDuration .StartTime }}</pre></li>
                <li class="list-group-item">
                  Last new path:
                  <pre>{{ formatDuration .LastPath }}</pre></li>
                <li class="list-group-item">
                  Last unique crash:
                  <pre>{{ formatDuration .LastCrash }}</pre></li>
                <li class="list-group-item">
                  Last unique hang:
                  <pre>{{ formatDuration .LastHang }}</pre></li>
              </ul>
            </div>
          </div>

          <div class="card stat">
            <h5 class="card-header">Stage progress</h5>
            <div class="card-body">
              <ul class="list-group list-group-flush">
                <li class="list-group-item">
                  <span data-toggle="tooltip" title="Total number of function calls attempted.">Total execs:</span>
                  <span class="badge badge-primary badge-pill">{{ formatNumber .ExecsDone }}</span></li>
                <li class="list-group-item">
                  <span data-toggle="tooltip" title="Number of function calls attempted since last recorded crash.">Execs since crash:</span>
                  <span class="badge badge-primary badge-pill">{{ formatNumber .ExecsSinceCrash }}</span></li>
                <li class="list-group-item">
                  <span data-toggle="tooltip" title="Current number of execs per second.">Exec speed:</span>
                  <span class="badge badge-primary badge-{{if lt .ExecsPerSec 20.0}}danger{{else if lt .ExecsPerSec 100.0}}warning{{else}}success{{end}}">{{ .ExecsPerSec }}/sec</span></li>
              </ul>
            </div>
          </div>

          <div class="card stat">
            <h5 class="card-header">Overall results</h5>
            <div class="card-body">
              <ul class="list-group list-group-flush">
                <li class="list-group-item">
                  <span data-toggle="tooltip" title="Count of queue passes done.">Cycles done:</span>
                  <span class="badge badge-primary badge-pill">{{ .CyclesDone }}</span></li>
                <li class="list-group-item">
                  <span data-toggle="tooltip" title="Number of test cases discovered.">Total paths:</span>
                  <span class="badge badge-primary badge-pill">{{ .PathsTotal }}</span></li>
                <li class="list-group-item">
                  <span data-toggle="tooltip" title="Number of unique crashes recorded.">Unique crashes:</span>
                  <span class="badge badge-primary badge-{{if ne .UniqueCrashes 0}}danger{{else}}secondary{{end}}">{{ .UniqueCrashes }}</span></li>
                <li class="list-group-item">
                  <span data-toggle="tooltip" title="Number of unique hangs encountered.">Unique hangs:</span>
                  <span class="badge badge-primary badge-{{if ne .UniqueHangs 0}}warning{{else}}secondary{{end}}">{{ .UniqueHangs }}</span></li>
              </ul>
            </div>
          </div>

          <div class="card stat">
            <h5 class="card-header">Path geometry</h5>
            <div class="card-body">
              <ul class="list-group list-group-flush">
                <li class="list-group-item">
                  <span data-toggle="tooltip" title="Path depth reached through the guided fuzzing process.">Levels:</span>
                  <span class="badge badge-primary badge-pill">{{ .MaxDepth }}</span>
                </li>
                <li class="list-group-item">
                  <span data-toggle="tooltip" title="Inputs that have not gone through any fuzzing yet.">Pending:</span>
                  <span class="badge badge-primary badge-pill">{{ .PendingTotal }}</span>
                </li>
                <li class="list-group-item">
                  <span data-toggle="tooltip" title="Inputs that the fuzzer really wants to get to in this queue cycle.">Pend fav:</span>
                  <span class="badge badge-primary badge-pill">{{ .PendingFavs }}</span>
                </li>
                <li class="list-group-item">
                  <span data-toggle="tooltip" title="New paths found during this fuzzing section.">Own finds:</span>
                  <span class="badge badge-primary badge-pill">{{ .PathsFound }}</span>
                </li>
                <li class="list-group-item">
                  <span data-toggle="tooltip" title="Paths imported from other fuzzer instances when doing parallelized fuzzing.">Imported:</span>
                  <span class="badge badge-primary badge-pill">{{ .PathsImported }}</span>
                </li>
                <li class="list-group-item">
                  <span data-toggle="tooltip" title="Consistency of observed traces.">Stability:</span>
                  <span class="badge badge-primary badge-success">{{ .Stability }}</span>
                </li>
              </ul>
            </div>
          </div>

        </div>
      </div>
      <div class="card-footer">
        <a id="checkFuzzer" href="/job/{{.GetJob.GUID}}/check?fid={{.AFLBanner}}" class="action check" data-method="POST">
          <svg class="bi" width="1.5em" height="1.5em" fill="currentColor" color="grey">
            <use xlink:href="/static/svg/bootstrap-icons.svg#check-circle-fill"/>
          </svg>
        </a>
        <a id="plotFuzzer" href="/job/{{.GetJob.GUID}}/plot?fid={{.AFLBanner}}" class="action plot" data-method="POST">
          <svg class="bi" width="1.5em" height="1.5em" fill="currentColor" color="green">
            <use xlink:href="/static/svg/bootstrap-icons.svg#bar-chart-fill"/>
          </svg>
        </a>
      </div>
    </div>

  {{end}}
  </div>
</div>
{{end}}
